package com.luoxin.servicemap.controller;

import com.luoxin.internalcommon.dto.ResponseResult;
import com.luoxin.internalcommon.response.TerminalResponse;
import com.luoxin.servicemap.service.TerminalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 高德地图创建服务
 */
@RestController
@RequestMapping("terminal")
public class TerminalController {
    @Autowired
    private TerminalService terminalService;
    @PostMapping("/add")
    public ResponseResult<TerminalResponse> add(String name,String desc){
        return terminalService.add(name,desc);
    }

    @GetMapping("/delete/{tid}")
    public ResponseResult delete(@PathVariable("tid") String tid){
        return terminalService.deleteTerminal(tid);
    }

    @GetMapping("/search")
    public ResponseResult search(){
        return terminalService.search();
    }


    @PostMapping("/aroundsearch")
    public ResponseResult<List<TerminalResponse>> aroundSearch(String center, Integer radius){
        return terminalService.aroundSearch(center,radius);
    }
}
